<template>
	<view>
	
		<!-- <uni-nav-bar left-icon="back" fixed="true" @clickLeft="onleft" left-text="返回" title="导航栏组件"></uni-nav-bar> -->
	
	<zolysoft-nav-bar></zolysoft-nav-bar>
	<zolysoft-nav-bar 
	    left-icon="back" 
	    left-text="返回" 
	    right-text="菜单" 
	    title="导航栏组件"
	    @click-left="toUpPage"
	    @click-right="showMenu" >
	</zolysoft-nav-bar>
	<button @click="ontosase">提示</button>
	<button @click="onhide">hide</button>
	<button @click="ontype">获取型号</button>
	{{type}}
	</view>
</template>

<script>
	import zolysoftNavBar from "@/components/zolysoft-nav-bar/zolysoft-nav-bar.vue"
	
	export default {
		data(){
			return{
				type:'',
			}
		},
	    components: {
	        zolysoftNavBar
	    },
		methods:{
			onleft(){
				uni.reLaunch({
					url:'../maintain/maintain'
				})
			},
			ontosase(){
				
					uni.showToast({
					    title: '提交成功',
						icon:'none',
					    duration: 2000
					});
				setTimeout(()=>{
				uni.redirectTo({
					url: '/pages/index/maintain/maintain'
				})
				},1000)
			},
			onhide(){
				uni.showLoading({
				    title: '加载中'
				});
				setTimeout(function () {
				   uni.hideLoading();
					 uni.showToast({
						title: '提交成功',
						icon:'success',
						duration: 1000,
						success: () => {
							setTimeout(()=>{
								uni.redirectTo({
									url: '/pages/index/maintain/maintain',
									})
							},1000)
							
						}
					 });
				}, 2000);
			},
		ontype(){
			this.type = this.$store.getters.getEquipmentInfo.type
		},
		}
	}
</script>

<style>
	.nav{
		background-color: #FFFFFF;
		border-bottom: 2rpx solid #999999;
	}
</style>
